package com.ksyun.ks3.services;

import java.io.File;
import java.util.List;

import android.content.Context;

import com.ksyun.ks3.exception.Ks3ClientException;
import com.ksyun.ks3.exception.Ks3ServiceException;
import com.ksyun.ks3.model.ObjectMetadata;
import com.ksyun.ks3.model.PartETag;
import com.ksyun.ks3.model.acl.AccessControlList;
import com.ksyun.ks3.model.acl.CannedAccessControlList;
import com.ksyun.ks3.model.result.AbortMultipartUploadResult;
import com.ksyun.ks3.model.result.CompleteMultipartUploadResult;
import com.ksyun.ks3.model.result.CopyObjectResult;
import com.ksyun.ks3.model.result.CreateBucketResult;
import com.ksyun.ks3.model.result.DeleteBucketResult;
import com.ksyun.ks3.model.result.DeleteObjectResult;
import com.ksyun.ks3.model.result.GetBucketACLResult;
import com.ksyun.ks3.model.result.GetObjectACLResult;
import com.ksyun.ks3.model.result.GetObjectResult;
import com.ksyun.ks3.model.result.HeadBucketResult;
import com.ksyun.ks3.model.result.HeadObjectResult;
import com.ksyun.ks3.model.result.InitiateMultipartUploadResult;
import com.ksyun.ks3.model.result.ListBucketsResult;
import com.ksyun.ks3.model.result.ListObjectsResult;
import com.ksyun.ks3.model.result.ListPartsResult;
import com.ksyun.ks3.model.result.PutBucketACLResult;
import com.ksyun.ks3.model.result.PutObjectACLResult;
import com.ksyun.ks3.model.result.PutObjectResult;
import com.ksyun.ks3.model.result.UploadPartResult;
import com.ksyun.ks3.services.handler.AbortMultipartUploadResponseHandler;
import com.ksyun.ks3.services.handler.CompleteMultipartUploadResponseHandler;
import com.ksyun.ks3.services.handler.CopyObjectResponseHandler;
import com.ksyun.ks3.services.handler.CreateBucketResponseHandler;
import com.ksyun.ks3.services.handler.DeleteBucketReplicationResponseHandler;
import com.ksyun.ks3.services.handler.DeleteBucketResponseHandler;
import com.ksyun.ks3.services.handler.DeleteObjectResponseHandler;
import com.ksyun.ks3.services.handler.GetBucketACLResponseHandler;
import com.ksyun.ks3.services.handler.GetBucketReplicationResponseHandler;
import com.ksyun.ks3.services.handler.GetObjectACLResponseHandler;
import com.ksyun.ks3.services.handler.GetObjectResponseHandler;
import com.ksyun.ks3.services.handler.HeadBucketResponseHandler;
import com.ksyun.ks3.services.handler.HeadObjectResponseHandler;
import com.ksyun.ks3.services.handler.InitiateMultipartUploadResponseHandler;
import com.ksyun.ks3.services.handler.Ks3HttpResponseHandler;
import com.ksyun.ks3.services.handler.ListBucketsResponseHandler;
import com.ksyun.ks3.services.handler.ListObjectsResponseHandler;
import com.ksyun.ks3.services.handler.ListPartsResponseHandler;
import com.ksyun.ks3.services.handler.PutBucketACLResponseHandler;
import com.ksyun.ks3.services.handler.PutBucketReplicationResponseHandler;
import com.ksyun.ks3.services.handler.PutObjectACLResponseHandler;
import com.ksyun.ks3.services.handler.PutObjectResponseHandler;
import com.ksyun.ks3.services.handler.UploadPartResponseHandler;
import com.ksyun.ks3.services.request.AbortMultipartUploadRequest;
import com.ksyun.ks3.services.request.CompleteMultipartUploadRequest;
import com.ksyun.ks3.services.request.CopyObjectRequest;
import com.ksyun.ks3.services.request.CreateBucketRequest;
import com.ksyun.ks3.services.request.DeleteBucketPolicyRequest;
import com.ksyun.ks3.services.request.DeleteBucketQuotaRequest;
import com.ksyun.ks3.services.request.DeleteBucketReplicationRequest;
import com.ksyun.ks3.services.request.DeleteBucketRequest;
import com.ksyun.ks3.services.request.DeleteObjectRequest;
import com.ksyun.ks3.services.request.GetBucketACLRequest;
import com.ksyun.ks3.services.request.GetBucketPolicyRequest;
import com.ksyun.ks3.services.request.GetBucketQuotaRequest;
import com.ksyun.ks3.services.request.GetBucketReplicationRequest;
import com.ksyun.ks3.services.request.GetObjectACLRequest;
import com.ksyun.ks3.services.request.GetObjectRequest;
import com.ksyun.ks3.services.request.HeadBucketRequest;
import com.ksyun.ks3.services.request.HeadObjectRequest;
import com.ksyun.ks3.services.request.InitiateMultipartUploadRequest;
import com.ksyun.ks3.services.request.Ks3HttpRequest;
import com.ksyun.ks3.services.request.ListBucketsRequest;
import com.ksyun.ks3.services.request.ListObjectsRequest;
import com.ksyun.ks3.services.request.ListPartsRequest;
import com.ksyun.ks3.services.request.PutBucketPolicyRequest;
import com.ksyun.ks3.services.request.PutBucketACLRequest;
import com.ksyun.ks3.services.request.PutBucketQuotaRequest;
import com.ksyun.ks3.services.request.PutBucketReplicationRequest;
import com.ksyun.ks3.services.request.PutObjectACLRequest;
import com.ksyun.ks3.services.request.PutObjectRequest;
import com.ksyun.ks3.services.request.UploadPartRequest;

public abstract interface Ks3 {

    public void listBuckets(ListBucketsResponseHandler resultHandler);

    public ListBucketsResult syncListBuckets() throws Ks3ClientException, Ks3ServiceException;

    public void listBuckets(ListBucketsRequest request,
                            ListBucketsResponseHandler resultHandler);

    public void getBucketACL(String bucketName,
                             GetBucketACLResponseHandler resultHandler);

    public GetBucketACLResult syncGetBucketACL(String bucketName)
            throws Ks3ClientException, Ks3ServiceException;

    public void getBucketACL(GetBucketACLRequest request,
                             GetBucketACLResponseHandler resultHandler);

    public GetBucketACLResult syncGetBucketACL(GetBucketACLRequest request)
            throws Ks3ClientException, Ks3ServiceException;

    public void putBucketACL(String bucketName,
                             AccessControlList accessControlList,
                             PutBucketACLResponseHandler resultHandler);

    public PutBucketACLResult syncPutBucketACL(String bucketName,
                                               AccessControlList accessControlList) throws Ks3ClientException, Ks3ServiceException;

    public void putBucketACL(String bucketName,
                             CannedAccessControlList CannedAcl,
                             PutBucketACLResponseHandler resultHandler);

    public PutBucketACLResult syncPutBucketACL(String bucketName,
                                               CannedAccessControlList accessControlList) throws Ks3ClientException, Ks3ServiceException;

    public void putBucketACL(PutBucketACLRequest request,
                             PutBucketACLResponseHandler resultHandler);

    public PutBucketACLResult syncPutBucketACL(PutBucketACLRequest request) throws Ks3ClientException, Ks3ServiceException;

    public void putObjectACL(String bucketName, String objectName,
                             CannedAccessControlList accessControlList,
                             PutObjectACLResponseHandler resultHandler);

    public PutObjectACLResult syncPutObjectACL(String bucketName, String objectName,
                                               CannedAccessControlList accessControlList) throws Ks3ClientException, Ks3ServiceException;

    public void putObjectACL(String bucketName, String objectName,
                             AccessControlList accessControlList,
                             PutObjectACLResponseHandler resultHandler);

    public PutObjectACLResult syncPutObjectACL(String bucketName, String objectName,
                                               AccessControlList accessControlList) throws Ks3ClientException, Ks3ServiceException;

    public void putObjectACL(PutObjectACLRequest request,
                             PutObjectACLResponseHandler resultHandler);

    public PutObjectACLResult syncPutObjectACL(PutObjectACLRequest request) throws Ks3ClientException, Ks3ServiceException;

    public void getObjectACL(String bucketName, String objectName,
                             GetObjectACLResponseHandler resultHandler);

    public GetObjectACLResult syncGetObjectACL(String bucketName,
                                               String objectName) throws Ks3ClientException, Ks3ServiceException;

    public void getObjectACL(GetObjectACLRequest request,
                             GetObjectACLResponseHandler resultHandler);

    public GetObjectACLResult syncGetObjectACL(GetObjectACLRequest request)
            throws Ks3ClientException, Ks3ServiceException;

    public void headBucket(String bucketname,
                           HeadBucketResponseHandler resultHandler);

    public HeadBucketResult syncHeadBucket(String bucketname) throws Ks3ClientException, Ks3ServiceException;

    public void headBucket(HeadBucketRequest request,
                           HeadBucketResponseHandler resultHandler);

    public HeadBucketResult syncHeadBucket(HeadBucketRequest request) throws Ks3ClientException, Ks3ServiceException;

    public boolean bucketExists(String bucketname);

    public void createBucket(String bucketname,
                             CreateBucketResponseHandler handlhandler);

    public CreateBucketResult syncCreateBucket(String bucketname) throws Ks3ClientException, Ks3ServiceException;

    public void createBucket(String bucketname, AccessControlList list,
                             CreateBucketResponseHandler handlhandler);

    public CreateBucketResult syncCreateBucket(String bucketname, AccessControlList list)
            throws Ks3ClientException, Ks3ServiceException;

    public void createBucket(String bucketname, CannedAccessControlList list,
                             CreateBucketResponseHandler handlhandler);

    public CreateBucketResult syncCreateBucket(String bucketname, CannedAccessControlList list)
            throws Ks3ClientException, Ks3ServiceException;

    public void createBucket(CreateBucketRequest request,
                             CreateBucketResponseHandler handlhandler);

    public CreateBucketResult syncCreateBucket(CreateBucketRequest request) throws Ks3ClientException, Ks3ServiceException;

    public void deleteBucket(String bucketname,
                             DeleteBucketResponseHandler handler);

    public DeleteBucketResult syncDeleteBucket(String bucketname) throws Ks3ClientException, Ks3ServiceException;

    public void deleteBucket(DeleteBucketRequest request,
                             DeleteBucketResponseHandler resultHandler);

    public DeleteBucketResult syncDeleteBucket(DeleteBucketRequest request) throws Ks3ClientException, Ks3ServiceException;

    public void listObjects(String bucketname,
                            ListObjectsResponseHandler resultHandler);

    public ListObjectsResult syncListObjects(String bucketname) throws Ks3ClientException, Ks3ServiceException;

    public void listObjects(String bucketname, String prefix,
                            ListObjectsResponseHandler resultHandler);

    public ListObjectsResult syncListObjects(String bucketname, String prefix)
            throws Ks3ClientException, Ks3ServiceException;

    public void listObjects(ListObjectsRequest request,
                            ListObjectsResponseHandler resultHandler);

    public ListObjectsResult syncListObjects(ListObjectsRequest request)
            throws Ks3ClientException, Ks3ServiceException;

    public void deleteObject(String bucketname, String objectKey,
                             DeleteObjectResponseHandler handler);

    public DeleteObjectResult syncDeleteObject(String bucketname, String objectKey)
            throws Ks3ClientException, Ks3ServiceException;

    public void deleteObject(DeleteObjectRequest request,
                             DeleteObjectResponseHandler handler);

    public DeleteObjectResult syncDeleteObject(DeleteObjectRequest request) throws Ks3ClientException, Ks3ServiceException;

    public Ks3HttpRequest getObject(Context context, String bucketname,
                                    String key, GetObjectResponseHandler getObjectResponceHandler);

    public Ks3HttpRequest getObject(GetObjectRequest request,
                                    GetObjectResponseHandler getObjectResponceHandler);

    public Ks3HttpRequest putObject(String bucketname, String objectkey,
                                    File file, PutObjectResponseHandler handler);

    public Ks3HttpRequest putObject(String bucketname, String objectkey,
                                    File file, ObjectMetadata objectmeta,
                                    PutObjectResponseHandler handler);

    public Ks3HttpRequest putObject(PutObjectRequest request,
                                    PutObjectResponseHandler handler);

    public void headObject(String bucketname, String objectkey,
                           HeadObjectResponseHandler resultHandler);

    public HeadObjectResult syncHeadObject(String bucketname, String objectkey)
            throws Ks3ClientException, Ks3ServiceException;

    public void headObject(HeadObjectRequest request,
                           HeadObjectResponseHandler resultHandler);

    public HeadObjectResult syncHeadObject(HeadObjectRequest request)
            throws Ks3ClientException, Ks3ServiceException;

    public void copyObject(String destinationBucket, String destinationObject,
                           String sourceBucket, String sourceKey,
                           CopyObjectResponseHandler handler);

    public CopyObjectResult syncCopyObject(String destinationBucket,
                                           String destinationObject, String sourceBucket, String sourceKey)
            throws Ks3ClientException, Ks3ServiceException;

    public void copyObject(String destinationBucket, String destinationObject,
                           String sourceBucket, String sourceKey,
                           CannedAccessControlList cannedAcl, CopyObjectResponseHandler handler);

    public CopyObjectResult syncCopyObject(String destinationBucket,
                                           String destinationObject, String sourceBucket, String sourceKey,
                                           CannedAccessControlList cannedAcl) throws Ks3ClientException, Ks3ServiceException;

    public void copyObject(String destinationBucket, String destinationObject,
                           String sourceBucket, String sourceKey,
                           AccessControlList accessControlList,
                           CopyObjectResponseHandler handler);

    public CopyObjectResult syncCopyObject(String destinationBucket,
                                           String destinationObject, String sourceBucket, String sourceKey,
                                           AccessControlList accessControlList) throws Ks3ClientException, Ks3ServiceException;

    public void copyObject(CopyObjectRequest request,
                           CopyObjectResponseHandler handler);

    public CopyObjectResult syncCopyObject(CopyObjectRequest request)
            throws Ks3ClientException, Ks3ServiceException;

    public void initiateMultipartUpload(String bucketname, String objectkey,
                                        InitiateMultipartUploadResponseHandler resultHandler);

    public InitiateMultipartUploadResult syncInitiateMultipartUpload(
            String bucketname, String objectkey) throws Ks3ClientException, Ks3ServiceException;

    public void initiateMultipartUpload(InitiateMultipartUploadRequest request,
                                        InitiateMultipartUploadResponseHandler resultHandler);

    public InitiateMultipartUploadResult syncInitiateMultipartUpload(
            InitiateMultipartUploadRequest request) throws Ks3ClientException, Ks3ServiceException;

    public void uploadPart(String bucketName, String key, String uploadId,
                           File file, long offset, int partNumber, long partSize,
                           UploadPartResponseHandler resultHandler);

    public void uploadPart(UploadPartRequest request,
                           UploadPartResponseHandler resultHandler);

    public void completeMultipartUpload(String bucketname, String objectkey,
                                        String uploadId, List<PartETag> partETags,
                                        CompleteMultipartUploadResponseHandler handler);

    public CompleteMultipartUploadResult syncCompleteMultipartUpload(
            String bucketname, String objectkey, String uploadId,
            List<PartETag> partETags) throws Ks3ClientException, Ks3ServiceException;

    public void completeMultipartUpload(ListPartsResult result,
                                        CompleteMultipartUploadResponseHandler handler);

    public CompleteMultipartUploadResult syncCompleteMultipartUpload(
            ListPartsResult result) throws Ks3ClientException, Ks3ServiceException;

    public void completeMultipartUpload(CompleteMultipartUploadRequest request,
                                        CompleteMultipartUploadResponseHandler handler);

    public CompleteMultipartUploadResult syncCompleteMultipartUpload(
            CompleteMultipartUploadRequest request) throws Ks3ClientException, Ks3ServiceException;

    public void abortMultipartUpload(String bucketname, String objectkey,
                                     String uploadId, AbortMultipartUploadResponseHandler handler);

    public AbortMultipartUploadResult syncAbortMultipartUpload(String bucketname, String objectkey,
                                                               String uploadId) throws Ks3ClientException, Ks3ServiceException;

    public void abortMultipartUpload(AbortMultipartUploadRequest request,
                                     AbortMultipartUploadResponseHandler handler);

    public AbortMultipartUploadResult syncAbortMultipartUpload(AbortMultipartUploadRequest request)
            throws Ks3ClientException, Ks3ServiceException;

    public void listParts(String bucketname, String objectkey, String uploadId,
                          ListPartsResponseHandler handler);

    public ListPartsResult syncListParts(String bucketname, String objectkey,
                                         String uploadId) throws Ks3ClientException, Ks3ServiceException;

    public void listParts(String bucketname, String objectkey, String uploadId,
                          int maxParts, ListPartsResponseHandler handler);

    public ListPartsResult syncListParts(String bucketname, String objectkey,
                                         String uploadId, int maxParts) throws Ks3ClientException, Ks3ServiceException;

    public void listParts(String bucketname, String objectkey, String uploadId,
                          int maxParts, int partNumberMarker, ListPartsResponseHandler handler);

    public ListPartsResult syncListParts(String bucketname, String objectkey,
                                         String uploadId, int maxParts, int partNumberMarker)
            throws Ks3ClientException, Ks3ServiceException;

    public void listParts(ListPartsRequest request,
                          ListPartsResponseHandler handler);

    public void putBucketCrr(PutBucketReplicationRequest request,
                             PutBucketReplicationResponseHandler handler);

    public void getBucketCrr(GetBucketReplicationRequest request,
                             GetBucketReplicationResponseHandler handler);

    public void deleteBucketCrr(DeleteBucketReplicationRequest request,
                                DeleteBucketReplicationResponseHandler handler);

    public void putBucketPolicy(PutBucketPolicyRequest request,
                                Ks3HttpResponseHandler handler);

    public void getBucketPolicy(GetBucketPolicyRequest request,
                                Ks3HttpResponseHandler handler);

    public void deleteBucketPolicy(DeleteBucketPolicyRequest request,
                                   Ks3HttpResponseHandler handler);

    public void putBucketQuota(PutBucketQuotaRequest request,
                               Ks3HttpResponseHandler handler);

    public void getBucketQuota(GetBucketQuotaRequest request,
                               Ks3HttpResponseHandler handler);

    public void deleteBucketQuota(DeleteBucketQuotaRequest request,
                                  Ks3HttpResponseHandler handler);

    public ListPartsResult syncListParts(ListPartsRequest request)
            throws Ks3ClientException, Ks3ServiceException;

    public void pause(Context context);

    public void cancel(Context context);

    public Context getContext();

    public GetObjectResult syncGetObject(GetObjectRequest request, File downloadFile,
                                         boolean append) throws Ks3ClientException, Ks3ServiceException;

    public GetObjectResult syncGetObject(Context context, File file, boolean append,
                                         String bucketname, String key,
                                         GetObjectResponseHandler getObjectResponceHandler) throws Ks3ClientException, Ks3ServiceException;

    public PutObjectResult syncPutObject(String bucketname, String objectkey, File file)
            throws Ks3ClientException, Ks3ServiceException;

    public PutObjectResult syncPutObject(String bucketname, String objectkey, File file,
                                         ObjectMetadata objectmeta) throws Ks3ClientException, Ks3ServiceException;

    public PutObjectResult syncPutObject(PutObjectRequest request) throws Ks3ClientException, Ks3ServiceException;

    public UploadPartResult syncUploadPart(String bucketName, String key,
                                           String uploadId, File file, long offset, int partNumber,
                                           long partSize) throws Ks3ClientException, Ks3ServiceException;

    public UploadPartResult syncUploadPart(UploadPartRequest request) throws Ks3ClientException, Ks3ServiceException;
}
